package cn.hxzy.service.impl;

import cn.hxzy.domain.Courseware;
import cn.hxzy.mapper.CoursewareMapper;
import cn.hxzy.service.CoursewareService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author niuyi
 * @since 2024-06-22
 */
@Service
public class CoursewareServiceImpl extends ServiceImpl<CoursewareMapper, Courseware> implements CoursewareService {
    @Autowired
    private CoursewareMapper coursewareMapper;

    @Override
    public List<Courseware> selectWareList(Integer sectionId) {
        QueryWrapper<Courseware> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("section_id", sectionId);

        List<Courseware> coursewares = coursewareMapper.selectList(queryWrapper);
        if (coursewares!=null) {
            return coursewares;
        }
        return null;

    }
}
